<?php


namespace app\admin\pms\controller;


use app\admin\pms\logic\GoodsSpecTplLogic;
use app\admin\pms\validate\GoodsSpecTplValidate;
use app\common\controller\BaseAdminController;

/**
 * 商品规格模板
 * Class GoodsAttrTplController
 * @package app\admin\pms\controller
 */
class GoodsSpecTplController extends BaseAdminController
{
    protected function init()
    {
        parent::init();
        $this->logic = new GoodsSpecTplLogic();
        $this->validate = new GoodsSpecTplValidate();
    }

    protected function searchWhere()
    {
        $where = [];
        $this->form['name'] && $where[] = ['name', 'like', "%{$this->form['name']}%"];
        return $where;
    }

    public function getAll()
    {
        return $this->success($this->logic->getList([]));
    }
}